import * as echarts from 'echarts'
import china from './china.json'

echarts.registerMap('china', { geoJSON: china })
export const options1 = {
  grid: {
    left: 0,
    top: 40,
    right: 0,
    bottom: 0,
    containLabel: true,
  },
  legend: {
    top: 0,
  },
  xAxis: {
    data: [
      "星期一",
      "星期二",
      "星期三",
      "星期四",
      "星期五",
      "星期六",
      "星期日",
    ],
  },
  yAxis: {
    splitLine: {
      lineStyle: {
        color: "rgba(255,255,255,.1)",
      },
    },
  },
  series: [
    {
      name: "一号",
      type: "bar",
      data: [200, 300, -100, -200, 300, 400, 200],
    },
    {
      name: "二号",
      type: "bar",
      data: [100, 200, -50, -200, 150, 200, 200],
    },
    {
      name: "三号",
      type: "bar",
      data: [50, -200, -100, -100, 100, 200, 200],
    },
  ],
};

export const options2 = {
  title: {
    text: "标题名称",
    textStyle: {
      fontSize: 10,
      color: "white",
    },
    top: 0,
  },
  grid: {
    left: 0,
    top: 40,
    right: 0,
    bottom: 0,
    containLabel: true,
  },  
  series: [
    {
      name: "pie",
      type: "pie",
      startAngle: "90",
      endAngle: "160",
      radius: ["60%", "70%"],
      center: ["50%", "60%"],
      data: [
        {
          value: 81,
          name: '81%'
        },
      ],
      label: {
        show: true,
        position: 'center'
      },
      labelLine: {
        show: false,
      },
    },
    {
      name: "pie",
      type: "pie",
      radius: ["48%", "50%"],
      center: ["50%", "60%"],
      data: [1],
      labelLine: {
        show: false,
      },
    },
  ],
};

export const options3 = {
  grid: {
    left: 0,
    top: 40,
    right: 0,
    bottom: 0,
    containLabel: true,
  },
  series: [{
    type: 'map',
    map: "china"
  }]
};

export const options4 = {
  grid: {
    left: 0,
    top: 40,
    right: 0,
    bottom: 0,
    containLabel: true,
  },
  legend: {
    top: 0,
  },
  xAxis: {
    data: [
      "星期一",
      "星期二",
      "星期三",
      "星期四",
      "星期五",
      "星期六",
      "星期日",
    ],
  },
  yAxis: {
    splitLine: {
      lineStyle: {
        color: "rgba(255,255,255,.1)",
      },
    },
  },
  series: [
    {
      name: "一号",
      type: "bar",
      data: [200, 300, -100, -200, 300, 400, 200],
    },
    {
      name: "二号",
      type: "bar",
      data: [100, 200, -50, -200, 150, 200, 200],
    },
    {
      name: "三号",
      type: "bar",
      data: [50, -200, -100, -100, 100, 200, 200],
    },
  ],
};
